<template>
  <div class="page-header col-xs-offset-2 col-xs-8">
    <h2>Vue路由测试{{a}}-{{b}}</h2>
    <button @click="tui">←后退</button>
    <button @click="jin">前进→</button>
    <br>
    <br>
    <img src="http://49.232.112.44/images/girl.gif" alt="" @mouseenter="toHome">
  </div>
</template>

<script>
  export default {
    name:'Header',
    props:['a','b'],
    methods: {
      toHome(){
        // 编写一段js代码，实现路由跳转（不借助<router-link>跳转）（编程式路由跳转）
        this.$router.push('/home')
      },
      tui(){
        this.$router.back()
      },
      jin(){
        this.$router.forward()
      }
    },
  }
</script>

<style scoped>
  img {
    width: 100px;
  }
</style>